package com.firefighting.service;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.firefighting.dao.TaskMapper;
import com.firefighting.entity.Task;

@Service
public class MaintenanceTaskService
{
	@Autowired
	private TaskMapper taskMapper;
	
	/**
	 * @author zhyan
	 * @function 查询维保任务列表
	 * @date 2018.6.25
	 */
	@SuppressWarnings("rawtypes")
	public List<HashMap> queryMaintenanceTaskList()
	{
		return taskMapper.selectMaintenanceTaskList();
	}
	@SuppressWarnings("rawtypes")
	public List<HashMap> queryExactMaintenanceTaskList(String id)
	{
		return taskMapper.selectExactMaintenanceTaskList(id);
	}
	@SuppressWarnings("rawtypes")
	public List<HashMap> queryEnterMaintenanceTaskList(Integer enterId){
		return taskMapper.selectEnterMaintenanceTaskList(enterId);
	}
	
	/**
	 * @author zhyan
	 * @function 根据id查询维保任务详细信息
	 * @date 2018.6.25
	 */
	@SuppressWarnings("rawtypes")
	public HashMap queryMaintenanceTaskById(int id)
	{
		return taskMapper.selectMaintenanceTaskById(id);
	}
	
	/**
	 * @author zhyan
	 * @function 根据id更新任务审核状态及审核意见
	 * @date 2018.6.25
	 */
	public int updateCheckResultAndOpinionById(int id, String status, String checkOpinion, String auditor)
	{
		return taskMapper.updateCheckResultAndOpinionById(id, status, checkOpinion, auditor);
	}
	
	/**
	 * @author zhyan
	 * @function 根据id查询任务
	 * @date 2018.7.5
	 */
	public Task queryTaskById(int id)
	{
		return taskMapper.selectByPrimaryKey(id);
	}
	/**
	 * @author Liuxc
	 * 根据合同查询任务
	 * */
	public List<HashMap> getTaskListByContracrId(int id) {
		// TODO Auto-generated method stub
		
		return taskMapper.getTaskListByContracrId(id);
	}
}